﻿<div class="" ng-controller="QuestionController">
    <div class="row">
        <a class="btn btn-info" ui-sref="question-item" href="#question-item">
            <b class="glyphicon glyphicon-plus"></b> New Question
        </a>
    </div>
    <div class="row">
        <div class="col-sm-9">
            <h2>Questions</h2>
            <ul class="question-list list-group">
                <li class="list-group-item list-group-item-info" ng-repeat="question in questions">
                    <h5><a ui-sref="question-detail({id: question.id})">{{question.title}}</a> - {{question.username}}</h5>
                    <p>Votes: <span class="badge">{{question.vote}}</span> </p>
                    <p>Views: <span class="badge">{{question.views}}</span> </p>
                    <p>Answers: <span class="badge">{{question.answers.length}}</span> </p>
                    <div ng-if="question.userId==currentId">
                        <button class="btn btn-info navbar-btn" ui-sref="question-item({id: question.id})">Update</button>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</div>